package com.chinasi.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.caland.framework.core.page.Pager;
import com.chinasi.common.EntityType;
import com.chinasi.dao.AgencyBasicDao;
import com.chinasi.model.AgencyBasic;
import com.chinasi.model.mvo.AgencyMvo;
import com.chinasi.service.AgencyBasicService;

@Service
public class AgencyBasicServiceImpl implements AgencyBasicService {

	/**
	 * AgencyBasicDAO
	 */
	@Autowired
	private AgencyBasicDao agencyBasicDao;

	@Override
	public Pager findPageCondition(AgencyBasic searchBean, int currentPage) {
		Pager pager = new Pager(agencyBasicDao.getTotalCount(searchBean),currentPage);
		pager.setData(agencyBasicDao.findByCondition(searchBean, pager.getStartRow(), pager.getPageSize()));
		return pager;
	}

	@Override
	public AgencyBasic findById(String id) {
		return agencyBasicDao.findByPK(id, AgencyBasic.class);
	}

}
